package com.qf.controller;

import com.qf.pojo.User;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author 86181
 * @Date 2022/9/4 19:43
 * @Version 1.0
 **/
@Controller
@RequestMapping("user")
public class UserController {
//    @RequestMapping(value = "addUser",method = RequestMethod.POST)
//    public String addUser(User user){
//        System.out.println(user);
//        return "success";
//    }
    @RequestMapping(value = "deleteUser")
    public String deleteUser(Date date){
        System.out.println(date);
        return "success";
    }
//    @RequestMapping(value = "deleteUser")
//    public String deleteUser(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date){
//        System.out.println(date);
//        return "success";
//    }
@RequestMapping(value = "getUser")
    public String getUser(@RequestParam("userName") String name,@RequestParam("passWord") String pwd){
    System.out.println("name:"+name);
    System.out.println("pwd:"+pwd);
        return "success";
    }
        @RequestMapping(value = "addUser",method = RequestMethod.POST)
        public String addUser(@RequestBody String user){
            System.out.println(user);
            return "success";
        }

        @RequestMapping("/updateUser/{id}")
    public String updateUser(@PathVariable("id") int aa){
            System.out.println(aa);
            return "success";
        }
}
